package com.imarkket;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.imarkket.R;

public class c_about extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.l_about);

        // Desactivar el teclado al entrar
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

        // Nombre de la aplicación
        TextView app_name_text = (TextView) findViewById(R.id.text_app_name);
        app_name_text.setText( getString(R.string.app_name));

        // Versión de la aplicación
        TextView app_version_text = (TextView) findViewById(R.id.text_app_version);
        app_version_text.setText( getString(R.string.app_version));

        // Mail de la aplicación
        TextView app_mail_text = (TextView) findViewById(R.id.text_app_mail);
        app_mail_text.setText( getString(R.string.app_mail));

        final Button button = (Button) findViewById(R.id.button_web);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                // Perform action on click

                // Url a cargar
                Uri uriUrl = Uri.parse( getString(R.string.url_web));
                Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
                startActivity(launchBrowser);

            }
        });
    }
}
